<template>
  <div class="release-container">
    <div class="header">
      <div>
        <span>发布</span>
      </div>
      <div class="right">
        <el-button type="text" icon="el-icon-more"></el-button>
        <el-button type="text" icon="el-icon-s-help"></el-button>
      </div>
    </div>
    <el-row class="tp">
      <el-col :span="24">
        <div class="avatar-container">
          <img :src="user.photo" style="width: 80px; height: 80px; border-radius: 50%" />
          <p>{{user.nickName}}</p>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <p style="color: #F4A780; font-size: 13px;">请选择发布类型，我们可以为您准确地匹配到合适的用户</p>
      </el-col>
    </el-row>
    <div class="end">
      <el-row>
        <el-col :span="24">
          <el-button round @click="handleRentOut">我要出租</el-button>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-button round @click="handleTransfer">我要转租</el-button>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-button round @click="handleSeekRent">我要求租</el-button>
        </el-col>
      </el-row>
    </div>

    <div class="footer">
      <div class="footer-item" @click="indexRental">
        <el-button icon="el-icon-s-home"></el-button>
        <span>首页</span>
      </div>
      <div class="footer-item" style="color: #F4A780;">
        <el-button icon="el-icon-circle-plus-outline"></el-button>
        <span>发布</span>
      </div>
      <div class="footer-item" @click="accelerate">
        <el-button icon="el-icon-orange"></el-button>
        <span>加速器</span>
      </div>
      <div class="footer-item active" @click="house">
        <el-button icon="el-icon-user"></el-button>
        <span>我的</span>
      </div>
    </div>
  </div>
</template>

<script>
import SubletStep1 from "@/views/SubletStep1.vue";

export default {
  data() {
    return {
      user: {}
    };
  },
  methods: {
    indexRental(){
      this.$router.push('/')
    },
    accelerate(){
      this.$router.push('/accelerate')
    },
    house(){
      this.$router.push('/house')
    },
    handleRentOut() {
      // Handle rent out action
      this.$router.push('/rentalForm1')
    },
    handleTransfer() {
      // Handle transfer action
      this.$router.push('/subletStep1')
    },
    handleSeekRent() {
      // Handle seek rent action
      this.$router.push('/rental-step1')
    },
    getUserInfo(){
      this.axios.get('http://localhost:9701/web/userInfo/getUserInfo').then(res => {
        this.user = res.data.data;
      })
    }
  },
  created() {
    this.getUserInfo();
  }
};
</script>

<style scoped>
.footer {
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #eee;
  position: fixed;
  bottom: 0;
  width: 390px;
  background-color: #fff;
}

.footer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
}

.footer-item button {
  background-color: transparent;
  font-size: 25px;
  border: none;
  color: unset;
}

.end button{
  width: 280px;
  height: 40px;
  border: 1px solid #F4A780;
  border-radius: 5px;
  background-color: transparent;
  color: #F4A780;
}

.header {
  color: #F4A780;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin: 0 10px;
}

.right {
  display: flex;
  border: 1px solid #F4A780;
  padding: 5px 5px;
  border-radius: 15px;
}

.right button {
  color: #F4A780;
  padding: 0 5px;
  font-size: 18px;
}

.release-container {
  width: 390px;
  margin: 0 auto;
}

.tp{
  margin-top: 30px;
}

.avatar-container p {
  margin-top: 8px;
  color: #F4A780;
}

</style>